function accuracy = SVM(data,classes )


train_data = data(1:1400,:);
test_data = data(1401:2000,:);

train_data_and_classes = [train_data classes(1:1400)];
test_data_and_classes = [test_data classes(1401:2000)];

rand_index_train = randperm(size(train_data,1));
rand_index_test = randperm(size(test_data,1));

rand_data_and_classes_train = train_data_and_classes(rand_index_train,:);
rand_data_and_classes_test = test_data_and_classes(rand_index_test,:);


options = optimset('maxiter',1000);
svmStruct = svmtrain(rand_data_and_classes_train(:,1:(size(rand_data_and_classes_train,2)-1)),rand_data_and_classes_train(:,size(rand_data_and_classes_train,2)),'QUADPROG_OPTS',options);


for i = 1:600
predicted_labels(i) = svmclassify(svmStruct,rand_data_and_classes_test(i,1:(size(rand_data_and_classes_test,2)-1)));
end
predicted_labels
size(predicted_labels)

count = 0;
for i = 1:600
    if predicted_labels(i) == rand_data_and_classes_test(i,size(rand_data_and_classes_test,2))
        count = count + 1;
    end
end

accuracy = count/600

[predicted_labels' rand_data_and_classes_test(:,size(rand_data_and_classes_test,2))]
end



